package ExampleDemo;

import java.util.Scanner;

public class Java输入功能求和 {
        public static void main(String[] args) {
      	    Scanner input =new Scanner(System.in);
      	    System.out.print("请输入最后元素值end=");
      	    int end=input.nextInt();
			int sum=0;
			for(int i=1;i<=end;i++){
				sum+=i;
			}
             System.out.println("1+2+·····"+"+"+end+"="+sum);
		}
}
